package com.novax.ex.activity.open.api.inner;

import com.novax.ex.activity.open.model.request.IeoRuleRequest;
import com.novax.ex.activity.open.model.response.IeoRuleResponse;
import com.novax.ex.common.results.ReturnResult;
import com.novax.ex.common.util.PageUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * description: IEO后台-规则配置
 *
 * @author shaw
 * @date 11/30/22 11:14
 */
@Tag(name = "IEO后台-规则配置", description = "IEO后台-规则配置")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "IeoInnerRuleApi", contextId = "IeoInnerRuleApi")
@RequestMapping("/v3/private/ieo/rules")
public interface IeoInnerRuleApi {

    @Operation(summary = "查询活动配置的规则")
    @GetMapping(value ="/{ieoId}")
    ReturnResult<List<IeoRuleResponse>> findByIeoId(@PathVariable Long ieoId);

    @Operation(summary = "新增")
    @PostMapping
    ReturnResult add(@RequestHeader("language") String language, @RequestBody IeoRuleRequest ruleRequest);

    @Operation(summary = "修改")
    @PutMapping(value = "/{id}")
    ReturnResult modify(@RequestHeader("language") String language, @PathVariable Long id, @RequestBody IeoRuleRequest ruleRequest);
}